/*
 * Created by JFormDesigner on Mon May 19 01:47:01 GMT+08:00 2025
 */

package com.soft.bams.server;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * @author wzs
 */
public class ServerPanel extends JPanel {
    public ServerPanel() {
        initComponents();
    }

    private void start(ActionEvent e) {
        // TODO add your code here
    }

    private void close(ActionEvent e) {
        // TODO add your code here
    }

    //跳转至RankPanel界面
    private void skipRank(ActionEvent e) {
        CardLayout card = (CardLayout)this.getParent().getLayout();
        card.show(this.getParent() , "rank");
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        titleLabel = new JLabel();
        startButton = new JButton();
        closeButton = new JButton();
        skipRankButton = new JButton();

        //======== this ========
        setLayout(null);

        //---- titleLabel ----
        titleLabel.setText("\u670d  \u52a1  \u5668");
        titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
        titleLabel.setFont(new Font("Microsoft YaHei UI", Font.BOLD, 28));
        add(titleLabel);
        titleLabel.setBounds(130, 55, 165, 30);

        //---- startButton ----
        startButton.setText("\u542f\u52a8");
        startButton.addActionListener(e -> start(e));
        add(startButton);
        startButton.setBounds(75, 150, 100, 30);

        //---- closeButton ----
        closeButton.setText("\u5173\u95ed");
        closeButton.addActionListener(e -> close(e));
        add(closeButton);
        closeButton.setBounds(265, 150, 100, 30);

        //---- skipRankButton ----
        skipRankButton.setText("\u5f00\u542f\u4e0a\u5e1d\u89c6\u89d2");
        skipRankButton.addActionListener(e -> skipRank(e));
        add(skipRankButton);
        skipRankButton.setBounds(140, 215, 155, 30);

        setPreferredSize(new Dimension(425, 335));
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel titleLabel;
    private JButton startButton;
    private JButton closeButton;
    private JButton skipRankButton;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
